﻿using AutoMapper;
using Model.Dto.AddressBook;
using Model.Dto.Dish;
using Model.Dto.Employee;
using Model.Dto.Orders;
using Model.Dto.Setmeal;
using Model.Dto.ShoppingCart;
using Model.Dto.Users;
using Model.Entitys;

namespace Common.Config
{
    /// <summary>
    /// Dto的映射配置
    /// </summary>
    public class AutoMapperConfigs: Profile
    {
        public AutoMapperConfigs()
        {
            CreateMap<EmployeeLoginReq, Employee>();
            CreateMap<EmployeeAdd, Employee>();
            CreateMap<EmployeeEdit, Employee>();
            CreateMap<Employee, EmployeeRes>();

            CreateMap<DishAdd, Dish>();
            CreateMap<Dish, DishDto>();
            CreateMap<DishDto, Dish>();
            //CreateMap<DishFlavor, DishDto>();

            CreateMap<Setmeal,SetmealRes>();
            CreateMap<SetmealAdd, Setmeal>();
            CreateMap<SetmealEdit, Setmeal>();
            CreateMap<SetmealDishesAdd, SetmealDish>();

            CreateMap<UserLogin, User>();

            CreateMap<ShoppingCartAdd, ShoppingCart>();

            CreateMap<AddressBookAdd, AddressBook>();
            CreateMap<AddressBookEdit, AddressBook>();

            CreateMap<OrderAdd, Orders>();
            CreateMap<OrderEdit, Orders>();
            CreateMap<Orders, OrderRes>();
        }
    }
}
